﻿using System.Web.Mvc;
using BankApp.Models;
using IBS.Math;

namespace BankApp.Controllers
{
    public class CreditCheckController : Controller
    {
        //
        // GET: /CreditCheck/

        public ActionResult Index()
        {
            return View(new CreditCheckModel());
        }

        public ActionResult Check(CreditCheckModel model)
        {
            model.Worthiness = Forecasting.Model.Forecast(model.Age, model.IncomeToDebtsRatio, model.PaymentHistory, 
                                                          model.Reliability, model.Income, model.Assets, model.FutureIncome) * 100;
            return View("Index", model);
        }
    }
}
